$ document .on \submit, \#upload-image-form, (e) !->
  e .prevent-default!
  $ .ajax @action, do
    data: $ this .serialize-array!
    files: $ \:file, this
    iframe: true
    dataType: 'script'
  .complete (data) ->
    data.responseText |> $ \#uploaded-image-list .prepend

$ document .on \change, \#upload-image, (e) ->
  'form' |> $ this .closest |> -> it .trigger \submit